//----------------------------------Include------------------------------------
#include <stdio.h>
#include <string.h>

#include "my_type_rdf.h"
#include "my_board.h"
#include "my_glbvar.h"
#include "my_ntc.h"
#include "my_guiapp.h"
//-----------------------------------------------------------------------------

//-----------------------------------Macro-------------------------------------
//-----------------------------------------------------------------------------

//---------------------------------Static Var----------------------------------
static  uint64_t      time_tick_2s;
static  float         Ohms;
//-----------------------------------------------------------------------------

//--------------------------------Static Func----------------------------------
static float _calc_Rs(float v)
{ 
  float  R;
  R = (v/3.3)*(10000)/(1-v/3.3);
  return R;
}
//-----------------------------------------------------------------------------

//--------------------------------Public Func----------------------------------
int main(void)
{
  MyBrd_Init();
  MyBrd_Init_ePaper();
  
  time_tick_2s = igu64_tick_ms;
  //MyMcu_Wdt_En();
  while(1){
    //MyMcu_Wdt_Feed();

    if(igu64_tick_ms > time_tick_2s + 5000){
      time_tick_2s = igu64_tick_ms;
      
      Ohms = _calc_Rs(igu32_adc_int*3.3/4096);
      gf_getTemp = MyNTC_Ohms2Temp(Ohms);
      
      MyGui_Exec();
      MyBrd_ePaper_Display();
    }
  }
  
  return 0;
}
//------------------------------------EOF--------------------------------------


